package com.netty.protobuf;




import com.netty.protobuf.BookMessage.Book;

import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.util.CharsetUtil;

public class NettyServerHandler extends ChannelInboundHandlerAdapter {

    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
        System.out.println("Server:"+ctx);
        BookMessage.Book message=(BookMessage.Book) msg;
        System.out.println("客户端接收到的数据:"+message.getName());
    }

}
